#pragma once
#include"Connetion.hpp"
#include "epoller.hpp"
#include <iostream>
#include"socket.hpp"
#include"common.hpp"
using namespace socketmodule;
class listener:public Connection
{
    public:
    listener(int port = defaultport):_port(port),_listsocket(std::make_unique<Tcpsocket>())
    {
        _listsocket->BuildTcpsocket(_port);
        Setevents(EPOLLIN);
        SetFD(_listsocket->Fd());
    }
    virtual void Recv() = 0;
    virtual void Send()
    {}
    virtual void Excepter()
    {}
    private:
    int _port;
    std::unique_ptr<Socket> _listsocket;
};